Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: Accessing DB2 via I need a sample code for connecting to DB2 using JAVA from Notes
~Emile Minnuter 25.Jan.04 11:19 AM a Web browser
Domino Designer 6.5 Windows 2000


Here is some sample code you can use to connect to DB2 using Java from Notes...

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.lang.*;
import java.io.*;
import java.sql.*;
import java.util.*;

import lotus.domino.*;

public class dxdocumentation extends NotesThread
{
protected static Connection connection = null;
protected static String szInputFile = null;

.
.
.

public static void main(String[] args)
{
if ((args[0].equalsIgnoreCase("IBM") == false) &&
(args[0].equalsIgnoreCase("ORACLE") == false) &&
(args[0].equalsIgnoreCase("Symantec") == false))
{
System.exit(0);
}

try
{
if (args[0].equalsIgnoreCase("IBM") == true)
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
else if (args[0].equalsIgnoreCase("ORACLE") == true)
Class.forName("oracle.jdbc.driver.OracleDriver");
else
Class.forName("symantec.itools.db.jdbc.Driver");
}
catch (Exception e)
{
System.out.println(e);
}
}

public void runNotes()
{
try
{
.
.
.
}
catch (SQLException sqle)
{
sqle.printStackTrace();
System.exit(-1);
}
catch (java.io.IOException ioe)
{
ioe.printStackTrace();
System.exit(-1);
}
catch (Exception e)
{
e.printStackTrace();
System.exit(-1);
}
}

public static void getDocumentationInformation()
throws java.io.IOException,
Exception
{
Database db = null;

.
.
.

connection = DriverManager.getConnection(szInputFile);

System.out.println("connected...");

.
.
.

connection.close();

System.out.println("closed...");
.
.
.

}

.
.
.
}




Accessing DB2 via I need a sample c... (~Lorraine Bubwe... 24.Jan.04)
. . RE: Accessing DB2 via I need a samp... (~Emile Minnuter... 25.Jan.04)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS